/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package binarysearchtree;
import java.util.Scanner;

public class BinarySearchTree {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        BSTree<Integer, String> bt = new BSTree<Integer, String>();
        
        bt.insert(23, "pol");
        bt.insert(5, "bill");
        bt.insert(53, "jane");
        bt.insert(59, "ban");
        bt.insert(2, "bin");
        bt.insert(9, "marshal");
        bt.insert(12, "vova");
        bt.insert(45, "kate");
        
        System.out.print("Find element of tree with key = 5:");
        System.out.println(bt.find(5).toString());
        System.out.println("\nInorder Tree Walk\n");
        bt.printInorderTree(bt.getRoot(), "");
        
        System.out.println("\nPost Order\n");
        bt.printPostOrder(bt.getRoot());
        
        System.out.println("\nPre Order\n");
        bt.printPreOrder(bt.getRoot());
        
        System.out.println("\nRemove element with key 23\n");
        bt.remove(23);
        
        System.out.println("\nInorder Tree Walk\n");
        bt.printInorderTree(bt.getRoot(), "");
        
        System.out.println("\nPost Order\n");
        bt.printPostOrder(bt.getRoot());
        
        System.out.println("\nPre Order\n");
        bt.printPreOrder(bt.getRoot());
    }
}
